class Solution {
public:
    long long countCompleteDayPairs(vector<int>& hours)
    {
        long long ans = 0;
        long long cnt[24] = { 0 };
        for (auto& a : hours) ans += cnt[(24 - (a % 24)) % 24], cnt[a % 24]++;
        return ans;
    }
};